﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xaml;
using System.CodeDom;

namespace NeuroSpeech.XamlExtensions
{
    public class InitializerWriter : XamlDirectiveWriter
    {

        public InitializerWriter():base(XamlLanguage.Initialization)
        {

        }


        #region public override void  WriteEndMember(XamlCodeContext context)
        public override void EndMember(XamlCodeContext context)
        {
            CodeVariableDeclarationStatement cvd = context.GetLastStatement<CodeVariableDeclarationStatement>(context.PreStatements);
            cvd.InitExpression = new CodePrimitiveExpression(context.Peek.Value.Value);
        }
        #endregion


    }
}
